/*
  格式化日期
*/
export function formateDate(time) {
  if (!time) return ''
  let date = new Date(time);
  let month = date.getMonth() + 1;
  let tempdate = date.getDate();
  let hours=date.getHours();
  let min=date.getMinutes();
  let sec=date.getSeconds();
  // console.log(date.getHours(),date.getMinutes(),date.getSeconds());
  return date.getFullYear() + '-' + (month.toString()[1] ? month : `0${month}`) + '-' + (tempdate.toString()[1] ? tempdate : `0${tempdate}`)
    + ' ' + (hours.toString()[1]?hours:`0${hours}`) + ':' + (min.toString()[1]?min:`0${min}`) + ':' + (sec.toString()[1]?sec:`0${sec}`);
}